#include <algorithm>
#include <string>
#include <vector>
using namespace std;

class Solution
{
public:
    static string solve(string s, string t)
    {
        int m = s.size(), n = t.size();
        vector<int> mul(m+n-1);
        for(int j=n-1; j>=0; j--)
        {
            for(int i=m-1; i>=0; i--)
            {
                mul[i+j] += (s[i]-'0')*(t[j]-'0');
            }
        }
        reverse(mul.begin(), mul.end());
        string ret;
        int carry = 0;
        for(auto i : mul)
        {
            ret += (carry+i)%10+'0';
            carry = (carry+i)/10;
        }
        if(carry)
            ret += carry+'0';
        
        while(ret.back()=='0' && ret.size()>1)
            ret.pop_back();
        reverse(ret.begin(), ret.end());
        return ret;
    }
};